#ifndef ACTIONS_H 
#define ACTIONS_H 

//#include "DatabaseDll.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include "Team10.h"

using namespace std;

void PerformAction ( int ChosenAction);	// Calls corresponding functin for the chosen action

// A function for each action

void NewVendor();	// Become an allowed vendor

void NewVendorFromFile();	// Insert new Vendor from File

void PrintVendorList();	// See list of allowed vendors

void NewCardOwner();	// Become a card owner

void NewCardOwnerFromFile();	// Insert new card owner from file

void PrintCardOwnerList();	// See list of card owners

void NewTransaction();	// Store a new transaction

void NewTransactionFromFile();	// Store transaction(s) from a file

void PrintMonthlyStatement();	// Print a monthly statement

void PrintVendorSummary();	// Print a vendor transaction summary

void QueryTransactionTable();	// Query the "Transactions Performed" table


// Helper functions

void FillInSpaces( string& Word );	// Replace all 'space' characters with '_', i.e. Burger King --> Burger_King
void IgnoreLeftOverInput();	// Ignores leftover input
void ReadSingleWord( string& word );	// Reads in one word, ignores the rest
void ReadSeveralWords( string& word );	// Reads in several words, fills in the spaces
bool ValidDate( string &Date );	// Checks for a valid overall date format
bool ValidDateValues( string Day, string Month, string Year );	// Checks if year, month and day values are valid
bool ValidYear( int Year );	// Checks if a valid year [0:9999] was entered
bool ValidMonth( int Month );	// Checks if a valid month [1:12] was entered

bool OpenFile( ifstream& is, string filename );	// Opens a file; Returns true if the file is successfully opened
void ReadWordFromFile( ifstream& is, string& Word );	// Reads one or more words from file

void ReadSixteenDigits( string& Number );	// Reads in Sixteen digits; makes sure the input is valid
void ReadDouble( string& Balance, string message );	// Reads in a double; makes sure the input is valid
void ShaveOffDigits( string& Balance );	// Used when we want no more than two digits after a decimal point

bool ValidTime( string Time );	// Checks for valid time format and time values
bool toInt( string s, int& i );	// Convert string s to an int

void RemoveComma( string& s );	// Removes comma from the end of string s (if it exists)

void PerformQuery( int ChosenQuery  );	// Performs the chosen query for option eleven
void QueryTransaction();	// Queries an individual transaction
void QueryTransaction_Date();	// Queries all transactions within a specific date range
void QueryTransaction_Time();	// Queries all transactions within a specific time range

#endif
